Official Guide to the Healogix’s Mouse Tracking Protocol.
This folder contains a template for running an online mouse tracking experiment.
Below is a table describing what each file is in this directory.
| file | description |
|---|---|
| data_dictionary.xlsx | a “dictionary” describing what every column of the output data is. |
| functions.js | javascript file containing custom written functions supporting the experimental protocol. Needs to be uploaded to cognition.run as an “External JS/CSS” |
| guide.md | this guide. |
| index.browser.js | code for conducting mouse tracking. Needs to be uploaded to cognition.run as an “External JS/CSS” |
| index.js | code for running the experimental protocol. DO NOT EDIT. Should be copy and pasted to the “Task Code” section of cognition.run |
| parameters.js | javascript code for defining experimental parameters. Edit this to customize the experiment. Needs to be uploaded to cognition.run as an “External JS/CSS”. |
| stimuli.js | javascript code defining the stimuli to use for each trial of the experiment. Needs to be uploaded to cognition.run as an “External JS/CSS”. |
| stimuli.xlsx | excel version of the stimuli.js. Lists the stimuli to display on each trial. Each row = single trial. |
| style.css | a cascading style sheet (.css). Controls the “style” of different elements of the experiment. Font size, color, position on the screen, etc. Needs to be uploaded to cognition.run as an “External JS/CSS”. |
| directory | description |
|---|---|
| ./data | directory containing an example output dataset. |
| ./img | directory containing example images from the jsPsych software package. |
| ./r | directory containing R helper and analysis scripts. |
| ./sound | directory containing example sound files. |
| ./video | directory containing example video files. |
To run a new experiment, complete the following steps:
Sign in to your account.
Create a new task by selecting “+ New task”. Give your new task a name. Hit Save.
Go to “Source code”. Copy and paste the code from the “index.js” file into the “Task Code” section. There should be no need to edit any code contained within this section.
Upload these files to the “External JS/CSS” section:
| file | description |
|---|---|
| functions.js | javascript file containing custom written functions supporting the experimental protocol. |
| index.browser.js | code for conducting mouse tracking. |
| parameters.js | javascript code for defining experimental parameters. Edit this to customize the experiment. |
| stimuli.js | javascript code defining the stimuli to use for each trial of the experiment. |
| style.css | a cascading style sheet (.css). Controls the “style” of different elements of the experiement. Font size, color, position on the screen, etc. |
Upload relevant stimuli to the “Stimuli” section.
If you completed Steps 1-7 correctly, you should see a preview of the template experiment in the “Task Preview” section:
Note: the fullscreen module at the beginning of the experiment does not work in the task preview section of cognition.run. It does work when given to participants. When previewing the template task with the fullscreen module, hit “Esc” on your keyboard to escape out of the fullscreen mode.
Edit these files to customize your experiment:
| file | description |
|---|---|
| parameters.js | javascript code for defining experimental parameters. Edit this to customize various aspects of the experiment. Parameters are organized by “event” type. |
| file | description |
|---|---|
| stimuli.js | javascript code defining the stimuli to use for each trial of the
experiment. Use the R helper script r/csv_to_json.r for
assistance creating this file. |
Edit an excel file:
Use the R helper script r/csv_to_json.r to convert excel
–> js: